#ifndef INFINITY_GRENADE_ENTITY_H
#	define INFINITY_GRENADE_ENTITY_H

#include "entity3D.h"
#include "servicephysics.h"

namespace infinity {

class GrenadeEntity
	:	public Entity3D
{
public : //! @name Constants
	//! @{
	static const dw::float32 InfiniteTime;
	//! @}

public : //! @name Types definitions
	//! @{
	typedef Entity3D super;
	//! @}

public : //! @name Entity Commands
	//! @{
	virtual void renderDebug();
	//! @}

public : //! @name Setup
	//! @{
	void setInitialPosition(const Vector3f& position);
	void setInitialVelocity(const Vector3f& velocity);
	void setTimeToLive(dw::float32 timeToLive);

	virtual const Matrix4f& getMatrix();
	//! @}

protected : //! @name Construction & Destruction
	//! @{
	friend class ServiceEntity;

	GrenadeEntity();
	virtual ~GrenadeEntity();
	//! @}

protected : //! @name Callbacks
	//! @{
	virtual State onInitializeSimulation();
	virtual void onUpdateSimulation(dw::float32 deltaT);
	virtual State onTerminateSimulation();

	virtual State onInitializeMedia();
	virtual void onUpdateMedia(dw::float32 deltaT);
	virtual State onTerminateMedia();
	//! @}

private : //! @name Data
	//! @{
	physics::Object* m_physicObject;
	Vector3f m_initialPosition;
	Vector3f m_initialVelocity;
	dw::float32 m_timeToLive;
	//! @}
};

} // namespace infinity

#include "grenadeentity.inl"

#endif // !INFINITY_GRENADE_ENTITY_H
